import { service } from '@/api/request.js'

export const getServiceList = (query) => {
  return service({
    url: '/service/service_list',
    method: 'get',
    params: query,
  })
}

export const deleteService = (form) => {
  return service({
    url: '/service/service_delete',
    method: 'post',
    params: form,
  })
}

export const serviceDetail = (query) => {
  return service({
    url: '/service/service_detail',
    method: 'get',
    params: query,
  })
}

export const serviceStat = (query) => {
  return service({
    url: '/service/service_static',
    method: 'get',
    params: query,
  })
}

export const servicePanelData = () => {
  return service({
    url: '/dashboard/panel_group_data',
    method: 'get',
  })
}

export const serviceFlowStatData = () => {
  return service({
    url: '/dashboard/flow_stat',
    method: 'get',
  })
}

export const servicePieChartData = () => {
  return service({
    url: '/dashboard/service_stat',
    method: 'get',
  })
}

export const serviceAddTcp = (data) => {
  return service({
    url: '/service/service_add_tcp',
    method: 'post',
    data,
  })
}

export const serviceUpdateTcp = (data) => {
  return service({
    url: '/service/service_update_tcp',
    method: 'post',
    data,
  })
}

export const serviceAddGrpc = (data) => {
  return service({
    url: '/service/service_add_grpc',
    method: 'post',
    data,
  })
}

export const serviceUpdateGrpc = (data) => {
  return service({
    url: '/service/service_update_grpc',
    method: 'post',
    data,
  })
}
